package com.example.mybaties.testone.property_editor;

import com.example.mybaties.testone.domain.Car;

import java.beans.PropertyEditorSupport;

public class CarPropertyEditor extends PropertyEditorSupport {

    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        String[] arr = text.split(",");
        Car car = new Car();
        car.setBrand(arr[0]);
        car.setColor(arr[1]);
        setValue(car);
    }
}
